package com.xmut.community.web;

import com.xmut.community.entity.Login;
import com.xmut.community.service.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("/login")
public class LoginController {

    @Autowired
    private LoginService loginService;

    @RequestMapping
    public String init(Model model){
        List<Login> logins = loginService.findAll();
        model.addAttribute("logins",logins);
        return "hello";
    }
}
